<template>
	<view class="app-container">
		<!-- 录播图站位 -->
		<view class="banner-container">
			<img src="https://axy-uni.oss-cn-beijing.aliyuncs.com/a202c44c2075478dbfac39baeb800046.png" alt="">
		</view>

		<!-- 选项 -->
		<view class="tab-container">
			<view class="tab-item" v-for="(item,index) in tabItemList" :key="index" @click="clickTab(item)">
				<view class="item-img">
					<img :src="item.img" :alt="item.name">
				</view>
				<view class="item-text">
					<text>{{item.name}}</text>
				</view>
			</view>
		</view>

	</view>
</template>
<script>
	export default {
		data() {
			return {
				// tab选项
				tabItemList: [{
					id: 1,
					name: '改啊',
					img: "https://axy-uni.oss-cn-beijing.aliyuncs.com/wenzheng.png"
				}, {
					id: 2,
					name: '西药咨询',
					img: "https://axy-uni.oss-cn-beijing.aliyuncs.com/wenzheng.png"
				}, {
					id: 3,
					name: '西药咨询',
					img: "https://axy-uni.oss-cn-beijing.aliyuncs.com/wenzheng.png"
				}]

			}
		},
		methods: {
			// 点击事假 
			clickTab(item) {
				// 根据这个参数跳页面嘛 

				console.log(item)
				// uni.$u.toast(`你点击了${item.name}-${item.id}`)
				if (item.id == 3) {
					uni.navigateTo({
						url: '../CM_inquire/index'
					});
				}
			}
		}

	}
</script>
<style lang="scss" scoped>
	.app-container {
		width: 100%;
		min-height: 100vh;
		background: #F4F6F7;

		.banner-container {
			background-color: #fff;
			width: 100%;
			height: 300rpx;
			margin-bottom: 20rpx;

			img {
				width: 100%;
				height: 300rpx;
			}
		}

		.tab-container {
			background-color: #fff;
			padding: 10rpx;
			width: calc(100% - 20rpx);
			height: 180rpx;
			// background: red;
			display: flex;
			justify-content: space-evenly;
			align-items: center;

			.tab-item {
				width: 150rpx;
				height: 150rpx;
				display: flex;
				justify-content: center;
				flex-wrap: wrap;
				align-items: center;

				.item-img {
					width: 120rpx;
					height: 120rpx;

					img {
						width: 100%;
						height: 100%;
					}
				}

				.item-text {
					text-align: center;
					width: 100%;
					font-weight: 800;
				}

			}
		}

	}
</style>